package dao

import "work-chess/model"

func AddUser(user model.UserInfo) (id uint, err error) {
	gdb.Create(&user)
	return user.ID, nil
}

func SelectUserName(username string) (id uint, password string, err error) {
	user := new(model.UserInfo)
	gdb.Where("user_name = ?", username).First(&user)
	return user.ID, user.PassWord, nil
}
